# load and display an image with Tkinter
# Tkinter only reads gif and ppm images
# use Python Image Library (PIL) for other image formats
# give Tkinter a namespace to avoid conflicts with PIL
# (they both have class Image) PIL is free from:
# http://www.pythonware.com/products/pil/index.htm

def func(progress, done):
    if done:
        print "Done uploading"
    else:
        print "At %s%%" % progress

from Tkinter import * 
import Tkinter as tk
from PIL import Image, ImageTk
import flickrapi

pics = ["Chad.jpg", "nasa2.jpg"]

api_key = 'a0102ccd7f58c9940b00cc857f3218d6'
api_secret = '4cc52ffb9ffc34fe'

def get_token():
    raw_input("Press ENTER after you authorized this program")

    

flickr = flickrapi.FlickrAPI(api_key, api_secret)

#(token, frob) = flickr.get_token_part_one(perms='write')
#if not token: get_token
#flickr.get_token_part_two((token, frob))






#flickr.upload(filename='nasa2.jpg', title='exiting turn 10', description='this is me in my c4 before it blew up @ TWS', tags='racing hpde "c4 corvette"', callback=func)







root = tk.Tk()
cv1 = tk.Canvas(root, width=1100, height=800)
 
cv1.pack(fill='both', expand='yes')

# open a jpeg file into an image object
# image should be in the source folder or give full path name

image1 = Image.open(pics[0])
image2 = Image.open(pics[1])

      # convert image object to Tkinter PhotoImage object
tkimage1 = ImageTk.PhotoImage(image1)
tkimage2 = ImageTk.PhotoImage(image2)
      # tk.NW anchors upper left corner of image
      # at canvas coordinates x=10, y=20
id=cv1.create_image(10, 20, image=tkimage1, anchor=tk.NW)
#cv1.delete(id)
cv1.create_image(10, 20, image=tkimage2, anchor=tk.NW)


root.mainloop()